package com.dhl.cloud.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dhl.cloud.common.Constants;
import com.dhl.cloud.common.http.HttpResult;
import com.dhl.cloud.course.entity.LessionTranscript;
import com.dhl.cloud.course.service.LessionTranscriptService;

@RestController
@RequestMapping(value = "/user")
public class LessionTranscriptController extends BaseController{

	@Autowired
	private LessionTranscriptService lessionTranscriptService;
    @Value("${fileUpload.rootSavePath}")
    private String rootSavePath;
    
    @PostMapping("saveLessionTranscript")
    public HttpResult saveLessionTranscript(@RequestBody LessionTranscript lessionfile,HttpServletRequest request)
    {
        int flag = lessionTranscriptService.insert(lessionfile,rootSavePath);
        return flag==1 ? HttpResult.success("操作成功"):HttpResult.error(Constants.ERROR_MSG_25);
    }
}
